<%@page import="com.us.usws.batch.BatchUtils"%>
<%@page import="com.us.usws.batch.resimp.result.ResImpResult"%>
<%@page import="com.us.usws.batch.BatchResImportor"%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"	language="java"%>
<html>
<head>
<title>批量导入</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
body {
	font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
	font-size: 9pt;
}
input, select {
	font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
	font-size: 9pt;
	border: 1px solid #003366;
}
table {
	font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
	border: 0px;
	padding: 0px;
	font-size: 9pt;
	margin: 6px;
	border-collapse: collapse;
}

td,th {
	border: 0px;
	padding: 4px;
	empty-cells: show;
}

a:LINK,a:ACTIVE,a:VISITED {
	text-decoration: none;
	color: blue;
}

a:HOVER {
	text-decoration: overline underline;
	color: red;
}
</style>
</head>
<%
String act=request.getParameter("act");
String cleanStr=request.getParameter("cleanBeforeInsert");

boolean cleanBeforeInsert=false;
if("on".equals(cleanStr)){
	cleanBeforeInsert=true;
}

String output="";
BatchResImportor imp=new BatchResImportor();
ResImpResult ret=null;
if("channel".equals(act)){
	ret=imp.impChannel(cleanBeforeInsert);
}else if("video".equals(act)){
	ret=imp.impVideo(cleanBeforeInsert);
}else if("region".equals(act)){
	ret=imp.impRegions();
}
output=BatchUtils.getImpOutput(ret);

%>
<body>
<table style="padding: 10px;border: 0;">
<tr valign="top">
<td style="border:0">
<fieldset>
<legend>批量导入</legend>
<table>
	<tr>
		<td>
		<form action="" method="POST">
		<input type="hidden" name="act" value="channel">
		<input type="checkbox" name="cleanBeforeInsert" checked="checked">导出前清空频道相关表&nbsp;&nbsp;
		<input type="submit" value="导入频道">
		</form>
		</td>
	</tr>
	<tr>
		<td>
		<form action="" method="POST">
		<input type="hidden" name="act" value="video">
		<input type="checkbox" name="cleanBeforeInsert" checked="checked">导出前清空视频相关表&nbsp;&nbsp;
		<input type="submit" value="导入视频">
		</form>
		</td>
	</tr>
	<tr>
		<td>
		<form action="" method="POST">
		<input type="hidden" name="act" value="region">
		<input type="submit" value="导入行政区划代码">
		</form>
		</td>
	</tr>	<tr><td><span style="color:red"><%=output %></span></td></tr>
</table>
</fieldset>
</td>

</tr>
</table>
</body>
</html>